package com.czh.subject.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum SubjectTypeEnum {
    RADIO(1,"单选"),
    MULTIPLE(2,"多选"),
    JUDGE(3,"判断"),
    BRIEF(4,"简答");

    private final long code;
    private final String type;

    public static SubjectTypeEnum getType(int code){
        for (SubjectTypeEnum subjectTypeEnum : SubjectTypeEnum.values()) {
            if (subjectTypeEnum.getCode()== code){
                return subjectTypeEnum;
            }
        }
        return null;
    }
}
